############# ########### ####### ##### ### ##
#
# Copyright (C) 2010 The Hursk Group, LLC
#
# This program is free software: you can redistribute it and/or modify 
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (See file named COPYING).  If not, see 
# <http://www.gnu.org/licenses/>.
# 
############# ########### ####### ##### ### ##

# This is for redhat_9
#
#
# local area to store the html files pulled form the site
errata_store_dir=redhat_3as/
# url base dir for redhat errata
errata_base_url=https://rhn.redhat.com/errata/
# The below url may change. use it to update the list of published errata
sec_list_url=https://rhn.redhat.com/errata/rhel3as-errata.html

wget --no-check-certificate -O - $sec_list_url > poo_redhat_3as_errata_list

for errata in `cat poo_redhat_3as_errata_list | grep middle | grep href | cut -f4 -d"\"" | cut -f3 -d"/"`
do
	wget --no-check-certificate -O - $errata_base_url$errata > $errata_store_dir$errata
done

rm poo_redhat_3as_errata_list
